package com.awenlchan.musicbox;

import android.os.Binder;

/**
 * Created by 10300 on 2017/3/22.
 */

public class MusicSpy extends Binder {
    public static final String ACTION_STOP = "stop";
    public static final String ACTION_START = "start";
    public static final String ACTION_PAUSE = "pause";

    private int max ;
    private int progress ;
    private String action ;
    private String music;
    private MusicService ms;

    public void setMs(MusicService ms) {
        this.ms = ms;
    }

    public String getMusic() {
        return music;
    }

    public void setMusic(String music1) {
        this.music = music1;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
        switch(action){
            case ACTION_START:
                ms.play(music);
                break;
            case ACTION_PAUSE:
                ms.pause();
                break;
            case ACTION_STOP:
                ms.stopPlay();
                break;
        }
    }

    public int getMax() {
        return max;
    }

    public void setMax(int max) {
        this.max = max;
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }
}
